//
//  LYQHomeTourismCell.m
//  ZCProject
//
//  Created by Zheng on 16/11/7.
//  Copyright © 2016年 Zheng. All rights reserved.
//

#import "LYQHomeTourismCell.h"

@implementation LYQHomeTourismCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self.contentView addSubview:self.titleBtn];
        [self.contentView addSubview:self.contentLbl];
        
        [self layoutSubviewsInContentView];
    }
    return self;
}

#pragma mark - layout subviews
- (void)layoutSubviewsInContentView {
    
    [_contentLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(kWScale(70));
        make.right.equalTo(self).offset(-35);
        make.top.mas_equalTo(15);
        make.bottom.mas_equalTo(-15);
    }];
    
    [_titleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(kWScale(45));
        make.height.mas_equalTo(kWScale(22.5));
        make.centerY.equalTo(_contentLbl).offset(-1);
        make.left.equalTo(self).offset(10);
    }];
    
}

#pragma mark load subviews
- (UIButton *)titleBtn {
    if (!_titleBtn) {
        _titleBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_titleBtn setImage:[UIImage imageNamed:@"caigoubg"] forState:UIControlStateNormal];
    }
    return _titleBtn;
}

- (UILabel *)contentLbl {
    if (!_contentLbl) {
        _contentLbl = [[UILabel alloc] init];
        _contentLbl.text = @"寻找意大利当地地接社,10月10日从北京出发,随时联络.";
        _contentLbl.font = kWFont(16);
        _contentLbl.textColor = kLYQBlack;
        _contentLbl.numberOfLines = 2;
    }
    return _contentLbl;
}



@end
